package com.amt.basic.controller;

import com.amt.basic.service.MemberCardService;
import com.amt.configure.ControllerLog;
import com.amt.configure.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员卡控制器
 */
@Api(tags = "会员相关消息订阅")
@RestController
@RequestMapping("mc_member")
public class MemberCardController {

    @Autowired
    private MemberCardService memberCardService;


    @ApiOperation(value = "会员服务-会员开卡", notes = "会员开卡")
    @ApiResponses({
            @ApiResponse(code = 0, message = "成功", response = ResultMsg.class),
            @ApiResponse(code = 1, message = "失败", response = ResultMsg.class)})
    @PostMapping("openMemberCard")
    @ControllerLog("会员开卡")
    public String openMemberCard(@RequestBody String param) {
        return memberCardService.openMemberCard(param);
    }

    @ApiOperation(value = "会员服务-积分余额变更", notes = "积分余额变更")
    @ApiResponses({
            @ApiResponse(code = 0, message = "成功", response = ResultMsg.class),
            @ApiResponse(code = 1, message = "失败", response = ResultMsg.class)})
    @PostMapping("memberPointAmountChange")
    @ControllerLog("积分余额变更")
    public String memberPointAmountChange(@RequestBody String param) {
        return memberCardService.memberPointAmountChange(param);
    }
}
